package com.buanalintas.sandals.pos.entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlTransient;

@Entity
@Table(name = "pos_master_size")
//@NamedQueries({
//    @NamedQuery(name = "PosMasterSize.findAll", query = "SELECT t FROM PosMasterSize t"),
//    @NamedQuery(name = "PosMasterSize.findBySync", query = "SELECT t FROM PosMasterSize t WHERE t.sync = :sync"),
//    @NamedQuery(name = "PosMasterSize.findBySizeId", query = "SELECT t FROM PosMasterSize t WHERE t.sizeId = :sizeId"),
//    @NamedQuery(name = "PosMasterSize.findBySizeCode", query = "SELECT t FROM PosMasterSize t WHERE t.sizeCode = :sizeCode"),
//    @NamedQuery(name = "PosMasterSize.findBySizeName", query = "SELECT t FROM PosMasterSize t WHERE t.sizeName = :sizeName")})
public class PosMasterSize implements Serializable {
    @OneToMany(mappedBy = "itemSizeId")
    private Collection<PosMasterItem> posMasterItemCollection;
    @OneToMany(mappedBy = "itemDetailSizeId")
    private Collection<PosMasterItemDetail> posMasterItemDetailCollection;

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "size_id")
    private Integer sizeId;
    @Column(name = "size_code")
    private String sizeCode;
    @Column(name = "size_name")
    private String sizeName;

    public PosMasterSize() {
    }

    public PosMasterSize(Integer sizeId) {
        this.sizeId = sizeId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getSizeId() {
        return sizeId;
    }

    public void setSizeId(Integer sizeId) {
        this.sizeId = sizeId;
    }

    public String getSizeCode() {
        return sizeCode;
    }

    public void setSizeCode(String sizeCode) {
        this.sizeCode = sizeCode;
    }

    public String getSizeName() {
        return sizeName;
    }

    public void setSizeName(String sizeName) {
        this.sizeName = sizeName;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sizeId != null ? sizeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof PosMasterSize)) {
            return false;
        }
        PosMasterSize other = (PosMasterSize) object;
        if ((this.sizeId == null && other.sizeId != null) || (this.sizeId != null && !this.sizeId.equals(other.sizeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        // return "com.buanalintas.sandals.pos.entities.PosMasterSize[sizeId=" + sizeId + "]";
        return sizeName;
    }

    @XmlTransient
    public Collection<PosMasterItem> getPosMasterItemCollection() {
        return posMasterItemCollection;
    }

    public void setPosMasterItemCollection(Collection<PosMasterItem> posMasterItemCollection) {
        this.posMasterItemCollection = posMasterItemCollection;
    }

    @XmlTransient
    public Collection<PosMasterItemDetail> getPosMasterItemDetailCollection() {
        return posMasterItemDetailCollection;
    }

    public void setPosMasterItemDetailCollection(Collection<PosMasterItemDetail> posMasterItemDetailCollection) {
        this.posMasterItemDetailCollection = posMasterItemDetailCollection;
    }
}
